package com.aptemo.webetek.server.handlers;

import com.aptemo.webetek.client.commands.Action;
import com.aptemo.webetek.client.commands.impl.GetTeamDetailsAction;
import com.aptemo.webetek.client.exceptions.BackendException;
import com.aptemo.webetek.client.exceptions.WebetekLoginException;
import com.aptemo.webetek.server.datastore.DataStoreAPI;
import com.aptemo.webetek.shared.TeamBean;

public class TeamDetailsHandler
		extends ActionHandler<GetTeamDetailsAction, TeamBean>
{
	
	public TeamDetailsHandler(DataStoreAPI dataService)
	{
		super(dataService);
	}

	public Class<? extends Action<?>> getActionType()
	{
		return GetTeamDetailsAction.class;
	}

	@Override
	public TeamBean invoke(GetTeamDetailsAction action) throws BackendException, WebetekLoginException
	{
		// return mparent.getBetGroups(action.getEmail());
		// return mparent.getBetGroupsByUserGroup(action.getUserGroupId());
		return dataService.getTeam(action.getId());
		//return mparent.getUserGroupDetails(action.getId());
	}

}
